﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Category</title>
</head>
<body>
    <div id="cate_title_block">
        <div id="cate_title_title">
            <div class="cate_title">
                网站分类</div>
        </div>
        <ul id="cate_item">
            @{
                List<Models.CategoryInfo> cateList = ViewBag.Cate as List<Models.CategoryInfo>;
                foreach (Models.CategoryInfo item in cateList)
                {
                    if (string.IsNullOrEmpty(item.ParentID))
                    {
                        string strID = "cate_item_";
                        strID += @item.CategoryID;
                <li id=@strID class="" onmouseout="cateHidden(@item.CategoryID)" onmouseover="cateShow(@item.CategoryID)">
                    <a href="">@item.CategoryName</a> </li>
                    }
                }
            }
        </ul>
        <div class="cate_bottom">
        </div>
    </div>
    <div id="cate_sub_block">
        @{
            var top = 30;
            foreach (Models.CategoryInfo item in cateList)
            {
                if (string.IsNullOrEmpty(item.ParentID))
                {

                    top = top + 20;
                    var topPix = top.ToString() + "px";
            <div id="cate_content_block_@(item.CategoryID)" class="cate_content_block_wrapper" style="top:@topPix;display:none;" onmouseout="cateHidden(@(item.CategoryID))" onmouseover="cateShow(@(item.CategoryID))">
                <div class="cate_content_top">
                </div>
                <div class="cate_content_block">
                    <ul>
                        @{    foreach (Models.CategoryInfo subItem in cateList)
                              {
                                  if (subItem.ParentID == item.CategoryID)
                                  {
                            <li>
                                @Html.ActionLink(subItem.CategoryName, "cate", "category", new { id = subItem.CategoryID }, null)
                            </li>
                                  }
                              }
                        }
                    </ul>
                </div>
                <div class="cate_content_bottom">
                </div>
            </div>
                }
            }
        }
    </div>
</body>
</html>
